package DesignPattern.Builder.Singleton.Hungry;

import Utils.Util;

public class Client {
    public static void main(String[] args) {
//        创建HungryStatic对象
        HungryStatic instance1 = HungryStatic.getInstance();
        HungryStatic instance2 = HungryStatic.getInstance();
//        判断是否是同一个对象
        System.out.println(instance1 == instance2);

        Util.divide();

        HungryStaticCode instanceCode1 = HungryStaticCode.getInstance();
        HungryStaticCode instanceCode2 = HungryStaticCode.getInstance();
        System.out.println(instanceCode1 == instanceCode2);

        Util.divide();

        HungryEnum instance3=HungryEnum.INSTANCE;
        HungryEnum instance4=HungryEnum.INSTANCE;
        System.out.println(instance3 == instance4);
    }
}
